package top.wshape1.rpc.filter;

import top.wshape1.rpc.common.Ordered;
import top.wshape1.rpc.common.exception.RpcException;
import top.wshape1.rpc.message.RpcMessage;

/**
 * @author Wshape1
 * @version 1.0
 * @description Rpc Filter
 * @since 2024-02-13
 */

public interface Filter extends Ordered {

    /**
     * do filter
     *
     * @param message     RpcMessage
     * @param filterChain FilterChain
     * @return true accept or false reject
     * @throws RpcException RpcException
     */
    boolean doFilter(RpcMessage message, FilterChain filterChain) throws RpcException;


}
